import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_dk_form/flutter_dk_form.dart';

class SingleShowDemoPage extends StatelessWidget {
  static const String routeName = '/page/single_show_demo';
  static const String name = "SingleShowDemoPage";

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("SingleShowDemoPage"),
      ),
      body: SingleChildScrollView(
        child: Column(
          children: <Widget>[
            Text('标题及内容Item(左右对齐)'),
            TitleContentLeftRightAlignItemWidget(
              title: '状态',
              data: '已经审核',
            ),
            Text('标题及内容Item(左右对齐),内容多行'),
            TitleContentLeftRightAlignItemWidget(
              title: '公寓地址',
              data: '2543-B 北京市佳和园小区2楼6单元201室A房间',
              maxLines: null,
            ),
            Text('标题及内容Item(左右对齐),文字链'),
            TitleContentLeftRightAlignItemWidget(
              title: '公寓地址',
              data: '2543-B 北京市佳和园小区2楼6单元201室A房间',
              textLink: true,
              textContentOverflowEllipsis: true,
              urlScheme: 'dkflutter://base/portal/message',
            ),
            Text('标题及内容标签(圆角背景标签) 单行'),
            TitleContentsLabelItemWidget(
              title: '房间：31141-A',
              data: getList(),
            ),
            Text('标题及内容标签(圆角背景标签) 多行'),
            TitleContentsLabelItemWidget(
              title: '房间：31141-A',
              data: getList1(),
            ),
          ],
        ),
      ),
    );
  }

  List<ContentBackgroundColorBean> getList() {
    List<ContentBackgroundColorBean> contentBackgroundColorBeans = List();
    ContentBackgroundColorBean contentBackgroundColorBean =
        ContentBackgroundColorBean(0xFF05D7AE, "可租房");
    contentBackgroundColorBeans.add(contentBackgroundColorBean);
    ContentBackgroundColorBean contentBackgroundColorBean1 =
        ContentBackgroundColorBean(0xFFF8A03E, "非隔断");
    contentBackgroundColorBeans.add(contentBackgroundColorBean1);
    ContentBackgroundColorBean contentBackgroundColorBean2 =
        ContentBackgroundColorBean(0xFF0096FF, "首次出租");
    contentBackgroundColorBeans.add(contentBackgroundColorBean2);
    return contentBackgroundColorBeans;
  }

  List<ContentBackgroundColorBean> getList1() {
    List<ContentBackgroundColorBean> contentBackgroundColorBeans = List();
    ContentBackgroundColorBean contentBackgroundColorBean =
    ContentBackgroundColorBean(0xFF05D7AE, "可租房");
    contentBackgroundColorBeans.add(contentBackgroundColorBean);
    ContentBackgroundColorBean contentBackgroundColorBean1 =
    ContentBackgroundColorBean(0xFFF8A03E, "非隔断");
    contentBackgroundColorBeans.add(contentBackgroundColorBean1);
    ContentBackgroundColorBean contentBackgroundColorBean2 =
    ContentBackgroundColorBean(0xFF0096FF, "首次出租");
    contentBackgroundColorBeans.add(contentBackgroundColorBean2);
    ContentBackgroundColorBean contentBackgroundColorBean3 =
    ContentBackgroundColorBean(0xFFC6C6C6, "已下架");
    contentBackgroundColorBeans.add(contentBackgroundColorBean3);
    ContentBackgroundColorBean contentBackgroundColorBean4 =
    ContentBackgroundColorBean(0xFFFF6F79, "隔断");
    contentBackgroundColorBeans.add(contentBackgroundColorBean4);
    ContentBackgroundColorBean contentBackgroundColorBean5 =
    ContentBackgroundColorBean(0xFFF8A03E, "非首次出租");
    contentBackgroundColorBeans.add(contentBackgroundColorBean5);
    return contentBackgroundColorBeans;
  }
}
